import request from '@/utils/request'

// 获取列表
export const getClassList = data => request({
  method: 'GET',
  url: '/admin/class/class',
  data
})

// 删除
export const delClassList = id => request({
  method: 'DELETE',
  url: '/admin/class/class/' + id

})

// 查询
export const chaClassList = params => request({
  method: 'GET',
  url: '/admin/class/class',
  params
})

// 添加
export const addClassList = data => request({
  method: 'POST',
  url: '/admin/class/class',
  data
})

// 修改
export const PutTagApi = data => request({
  method: 'PUT',
  url: `/admin/class/class/${data.id}`,
  data
})

// 获取所有分类

export const getClassName = () => request({
  method: 'GET',
  url: '/admin/subject/tree'

})

// 获取老师、助教、班主任等信息
export const TeacherClassListApi = params => {
  return request({
    url: '/admin/class/teacher',
    params
  })
}

// 班级信息状态修改
export const StateTagyApi = data => {
  return request({
    url: `/admin/class/class/${data.id}`,
    method: 'PUT',
    data
  })
}

// 班级信息表单回显
export const StateClassListApi = id => {
  return request({
    url: `/admin/class/class/${id}`
  })
}

// 班级信息增加新增
export const PostClassApi = data => {
  return request({
    url: '/admin/class/class',
    method: 'POST',
    data
  })
}
